from rest_framework import serializers

from .models import BannerInfo
class BannerInfoModelSerializer(serializers.ModelSerializer):
    """轮播图序列化器"""
    # 模型类声明
    class Meta:
        model = BannerInfo
        fields = ["image", "link"]


from .models import NavInfo
class NavInfoModelSerializer(serializers.ModelSerializer):
    """导航序列化器"""
    class Meta:
        model = NavInfo
        fields = ["id","name","link"]